import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "@/views/Login";
import AdminManager from "@/views/AdminManager";
import VaccineManager from "@/views/VaccineManager";
import Appointment from "@/views/Appointment";
import AccountManage from "@/views/AccountManage";
import AppointmentMsg from "@/views/AppointmentMsg";
import UserLogin from "@/views/UserLogin";
import UserManager from "@/views/UserManager";
import UserVaccineShow from "@/views/UserVaccineShow";
import UserRegister from "@/views/UserRegister";
import UserOrderList from "@/views/UserOrderList";
import UserMsgMain from "@/views/UserMsgMain";
import UserModify from "@/views/UserModify";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: Login
  },
  {
    path:'/adminManager',
    name:'管理员管理',
    component: AdminManager,
    redirect:'/vaccineManager',
    children:[
      {
        path:'/vaccineManager',
        name:'疫苗管理',
        component:VaccineManager
      },
      {
        path:'/appointment',
        name:'疫苗预约',
        component:Appointment
      },
      {
        path:'/appointmentMsg',
        name:'预约列表',
        component:AppointmentMsg
      },
      {
        path:'/manager',
        name:'账户管理',
        component:AccountManage
      }
    ]
  },
  {
    path: '/userlogin',
    name: 'userLogin',
    component: UserLogin
  },
  {
    path:'/userRegister',
    name:'用户注册',
    component:UserRegister
  },
  {
    path:'/userModify',
    name:'用户信息修改页',
    component:UserModify
  },
  {
    path:'/usermanager',
    name:'用户管理',
    component: UserManager,
    redirect:'/userVaccineShow',
    children:[
      {
        path:'/userVaccineShow',
        name:'用户主页',
        component:UserVaccineShow
      },
      {
        path:'/userOrderList',
        name:'用户订单',
        component:UserOrderList
      },
      {
        path:'/userMsgMain',
        name:'用户信息页',
        component:UserMsgMain
      },

    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
